<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>接口文档登陆</title>

    <!-- Bootstrap core CSS -->
    <link href="{:base_url()}Public/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="{:base_url()}/Public/css/login.css">
    <script src="{:base_url()}Public/js/jquery-1.10.1.min.js"></script>
    <script src="{:base_url()}Public/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
	<style type="text/css">

	</style>

  </head>

  <body>

    <div class="container">

      <form class="form-signin">
        <h2 class="form-signin-heading">你正在登陆接口文档</h2>
        <label for="inputuname" class="sr-only">用户名</label>
        <input type="uname" id="inputuname" class="form-control" placeholder="请输入用户名" autofocus>
        <label for="inputPassword" class="sr-only">密码</label>
        <input type="password" id="inputPassword" class="form-control" placeholder="请输入密码">
        <!--<div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> 记住密码
          </label>
        </div>-->
        <button class="btn btn-lg btn-primary btn-block" type="submit" id="sub">登陆</button>
      </form>

    </div> <!-- /container -->


	<script type="text/javascript">
	$(document).ready(function(){

    $('button[type="submit"]').click(function(){
         var u_name=$('#inputuname').val();
         var pwd=$('#inputPassword').val();
         $.post('{:U("Login/login")}',{admin_name:u_name,a_password:pwd},function(ret){
           if(ret.status==200){
             window.location.href="{:U('Index/index')}";
           }else{
             alert(ret.message);
           }
         },'json');
         return false;
    });
    
    
		
	});
	</script>
  </body>
</html>
